<?php
mysql_connect("localhost", "", "");
mysql_query("USE stats_syslog");

$query = "select distinct Recipient FROM maillog, users WHERE timestamp>='2007-12-06 06:25:00' AND Recipient=user AND reason='Invalid Recipient' order by Recipient";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);

for ($count=0; $count<$numrows; $count++) {
	$user = mysql_result($result, $count, Recipient);
	$query = "delete from users where user='$user'";
	print "$query<BR>";
	mysql_query($query);
}

mysql_close();
?>
